<?php
include_once "conn.php";
$echarts=[]; //图表数据
$sql = $db -> query("SELECT goods_type,COUNT(*) AS goods_num FROM goods GROUP BY goods_type");
while ($row = $sql -> fetch_assoc()) {
    array_push($echarts,$row);
}
echo json_encode($echarts);
$db->close();
?>